$(function() {
	$('#vue_vm_list div').hide();
});

var nursingCostHistory = {
	id: '',
	nursingCostId: '',
	price: '',
	createTime: '',
	updateTime: '',
	createId: getLoginedUser()? getLoginedUser().staffId: '',
	updateId: getLoginedUser()? getLoginedUser().staffId: '',
	remark: '',
	nursingCostName: '',
};

findAll();

function save() {
	view.data.id = (view.data.id==''? 0: parseInt(view.data.id));
	view.data.price = (view.data.price==''? 0: parseFloat(view.data.price));

	save_basic(path+'/nursingCostHistory/save', {nursingCostHistory:view.data}, function() {
		alert('保存成功');
		findAll();
	});
}

function findAll() {
	if($('#vue_vm_list').length==0) {return;}
	$('#vue_vm_list div').hide();
	var nursingCostId = $.url().param('nursingCostId');

	find_basic_by_json(path+'/nursingCostHistory/find', {nursingCostId: nursingCostId}, function(response) {
		$('#vue_vm_list').html(gl_vue_vm_list_html);
		
		new Vue({
			el: '#vue_vm_list',
			data: {
				todos: response.data
			}
		});
		
		$('#vue_vm_list div').show();
	});
}

function deleteBatch() {
	deleteBatch_basic(path+'/nursingCostHistory/deleteBatch');
}
